package chapter07

import scala.collection.immutable
import scala.collection.parallel.immutable.ParSeq

/**
 *
 * @author cdhuangchao3
 * @date 2023/6/11 3:28 PM
 */
object Test20_Parallel {
  def main(args: Array[String]): Unit = {
    val result: immutable.IndexedSeq[String] = (1 to 100).map(
      x => Thread.currentThread().getName
    )
    println(result)
    val result2: immutable.IndexedSeq[Long] = (1 to 100).map(
      x => Thread.currentThread().getId
    )
    println(result2)
    val result3: ParSeq[Long] = (1 to 100).par.map(
        x => Thread.currentThread().getId
    )
    println(result3)

  }
}
